/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.ieslaferreria.creditsintesis.logicgame.statemachineimpl;




/**
 *maquina de estados de nuestro player
 * @author Administrador
 */
public class PlayerStateMachine extends GenericStateMachine implements MobileStateMachine{

    private static final int ST_ST = ST_STOPPED;
    private static final int ST_TR = ST_TO_RIGHT;
    private static final int ST_TB = ST_TO_BACK;
    private static final int ST_TF = ST_TO_FORWARD;
    private static final int ST_TL = ST_TO_LEFT;
    private static final int ER = ERROR;

    public int[][] statesMoving =
       {/*STOP   GO_F   GO_B   SP_R   SP_L   FR_W   OBS   */
/*ST_ST*/{ST_ST, ST_TF, ST_TB, ST_TR, ST_TL, ST_ST, ST_ST,},
/*ST_TF*/{ST_ST, ST_TF, ST_TF, ST_TF, ST_TF, ST_ST, ST_ST,},
/*ST_TB*/{ST_ST, ST_TB, ST_TB, ST_TB, ST_TB, ST_ST, ST_ST,},
/*ST_TR*/{ST_ST, ST_TR, ST_TR, ST_TR, ST_TR, ST_ST, ST_ST,},
/*ST_TL*/{ST_ST, ST_TL, ST_TL, ST_TL, ST_TL, ST_ST, ST_ST,}
    };


/*    public static final int ST_SPINING_RIGHT = 5;
    public static final int ST_MOVING_BACK = 6;
    public static final int ST_MOVING_FORWARD = 7;
    public static final int ST_SPINING_LEFT = 8;

    private static final int ER = ERROR;

    /*activators
    public static final int TR_MOVED = 5;
    public static final int TR_SPINNED = 8;
    public static final int TR_RELEASE_KEY = 9;

        /*  {ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR} */
       /*states , activators
    public int[][] statesMoving =
                     {/*STOP            GO_F              SPIN_R            SPIN_L                GO_B              MOVED            FREE_WAY          OBSTACLE          SPINNED           RELEASE_KEY*/
/*ST_STOPPED       {ST_STOPPED,       ST_TO_FORWARD,    ST_SPINING_RIGHT, ST_SPINING_LEFT,      ST_TO_BACK,       ST_STOPPED,      ST_STOPPED,       ST_STOPPED,       ST_STOPPED,       ST_STOPPED},
/*ST_TO_RIGHT      {ST_TO_RIGHT,      ST_TO_RIGHT,      ST_TO_RIGHT,      ST_TO_RIGHT,          ST_TO_RIGHT,      ST_TO_RIGHT,     ST_SPINING_RIGHT, ST_STOPPED,       ST_TO_RIGHT,      ST_STOPPED},
/*ST_TO_BACK       {ST_TO_BACK,       ST_TO_BACK,       ST_TO_BACK,       ST_TO_BACK,           ST_TO_BACK,       ST_STOPPED,      ST_MOVING_BACK,   ST_STOPPED,       ST_TO_BACK,       ST_STOPPED},
/*ST_TO_FORWARD    {ST_TO_FORWARD,    ST_TO_FORWARD,    ST_TO_FORWARD,    ST_TO_FORWARD,        ST_TO_FORWARD,    ST_STOPPED,      ST_MOVING_FORWARD,ST_STOPPED,       ST_TO_FORWARD,    ST_STOPPED},
/*ST_TO_LEFT       {ST_TO_LEFT,       ST_TO_LEFT,       ST_TO_LEFT,       ST_TO_LEFT,           ST_TO_LEFT,       ST_TO_LEFT,      ST_SPINING_LEFT,  ST_STOPPED,       ST_TO_LEFT,       ST_STOPPED},
/*ST_SPINING_RIGHT {ST_SPINING_RIGHT, ST_SPINING_RIGHT, ST_SPINING_RIGHT, ST_SPINING_RIGHT,     ST_SPINING_RIGHT, ST_SPINING_RIGHT,ST_SPINING_RIGHT, ST_STOPPED,       ST_STOPPED,       ST_SPINING_RIGHT},
/*ST_MOVING_BACK   {ST_MOVING_BACK,   ST_MOVING_BACK,   ST_MOVING_BACK,   ST_MOVING_BACK,       ST_MOVING_BACK,   ST_STOPPED,      ST_MOVING_BACK,   ST_STOPPED,       ST_MOVING_BACK,   ST_MOVING_BACK},
/*ST_MOVING_FORWARD{ST_MOVING_FORWARD,ST_MOVING_FORWARD,ST_MOVING_FORWARD,ST_MOVING_FORWARD,    ST_MOVING_FORWARD,ST_STOPPED,      ST_MOVING_FORWARD,ST_STOPPED,       ST_MOVING_FORWARD,ST_MOVING_FORWARD},
/*ST_SPINING_LEFT  {ST_SPINING_LEFT,  ST_SPINING_LEFT,  ST_SPINING_LEFT,  ST_SPINING_LEFT,      ST_SPINING_LEFT,  ST_SPINING_LEFT, ST_SPINING_LEFT,  ST_STOPPED,       ST_STOPPED,       ST_SPINING_LEFT}};

*/


    public PlayerStateMachine (){
        this.stateMatrix = statesMoving;
/*at first the state will be always 0, meaning that you are at the map scenery and wihtout moving.*/
        this.state = ST_STOPPED;

    }


}
